<?php

use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;

class Messages extends AbstractMigration
{
    public function up()
    {
        $users = $this->table('messages', array('comment' => '短信'));
        $users->addColumn('sources', 'string', array('limit' => 20, 'comment' => '信息来源','null' => true))
              ->addColumn('body', 'string', array('comment' => '信息内容','default' => ''))
              ->addColumn('send_time', 'timestamp', array('default' => 'CURRENT_TIMESTAMP', 'comment' => '发送时间'))
              ->save();     
    }

    /**
     * Migrate Down.
     */
    public function down()
    {
        $this->dropTable('messages');
    }
}
